package com.ss.user.service.impl;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ss.user.dao.RoleDao;
import com.ss.user.pojo.Role;
import com.ss.user.pojo.RoleAuthority;
import com.ss.user.service.RoleService;

/**
 * 角色service
 *
 */
@Service("roleService")
public class RoleServiceImpl implements RoleService{
	@Autowired
	private RoleDao dao;
	/**
	 * 新增角色
	 * @param role
	 * 
	 */
	public void addRole(Role role) {
		dao.addRole(role);
	}
	/**
	 * 更新角色
	 * @param role
	 * 
	 */
	public void updateRole(Role role) {
		dao.updateRole(role);
	}
	/**
	 * 查询角色
	 * @param role
	 * @return
	 * 
	 */
	public Role queryRole(Role role) {
		return dao.queryRole(role);
	}
	/**
	 * 根据IP查询角色
	 * @param id
	 * @return
	 * 
	 */
	public Role queryRoleById(String id) {
		return dao.queryRoleByID(id);
	}
	/**
	 * 查询角色功能关联
	 * @param roleAuthority
	 * @return
	 * 
	 */
	@Override
	public List<RoleAuthority> queryRoleAuthority(RoleAuthority roleAuthority) {
		return dao.queryRoleAuthority(roleAuthority);
	}
	/**
	 * 新增角色功能关联
	 * @param roleAuthority
	 * 
	 */
	@Override
	public void addRoleAuthority(RoleAuthority roleAuthority) {
		dao.addRoleAuthority(roleAuthority);
	}
	/**
	 * 删除角色功能关联
	 * @param roleAuthority
	 * 
	 */
	@Override
	public void deleteRoleAuthority(RoleAuthority roleAuthority) {
		dao.deleteRoleAuthority(roleAuthority);
	}

}
